package com.rx.util;

import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
import org.springframework.security.authentication.encoding.PasswordEncoder;

import com.rx.common.Constants;

/**
 * 密码加密工具类
 * 
 * @author Renxin
 * 
 */
public class PasswordEncoderUtils {

	private static PasswordEncoder passwordEncoder = new Md5PasswordEncoder();

	/**
	 * 密码加密
	 * 
	 * @param passWord
	 *            密码
	 * @return
	 */
	public static String encodePassword(String passWord) {
		return passwordEncoder.encodePassword(passWord, Constants.SECRET_KEY);
	}

}
